<template>
  <div class="file-container">
    <div class="file-core">
      <el-card class="box-card">
        <el-table
          ref="multipleTable"
          :data="file"
          tooltip-effect="dark"
          style="width: 100%">
          <el-table-column prop="id" label="编号" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="filingTime" label="归档时间" align="center"  min-width="10%"></el-table-column>
          <el-table-column prop="dept" label="部门" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="position" label="岗位" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="salaryRange" label="工资范围" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="conditions" label="招聘条件" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="jobContent" label="招聘内容" min-width="10%" align="center"></el-table-column>
          <el-table-column prop="dateRange" label="时间范围" min-width="15%" align="center"></el-table-column>
          <el-table-column label="操作" min-width="10%" align="center">
            <template slot-scope="scope">
              <el-button  type="danger" @click="delBtn(scope.row.id)" icon="el-icon-delete" size="mini"></el-button>
            </template>
          </el-table-column>
        </el-table>
      </el-card>
    </div>
  </div>
</template>

<script>

import {del, RecruitSearchPage} from "@/api/recruit";

export default {
  data(){
    return{
      query:{
        status:1
      },
      file: [],
      multipleSelection: [],
      current:1,
      pageSize:10
    }
  },
  methods: {
    async filePage(){
      const {data:res} = await RecruitSearchPage(this.current,this.pageSize,this.query)
      this.file = res.data.records
    },
    delBtn(id){
      this.$confirm('此操作将永久删除招聘简章, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        del(id).then(res => {
          this.$message({
            type: 'success',
            message: res.message
          });
          this.filePage()
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    }
  },
  created() {
    this.filePage()
  }
}
</script>

<style scoped lang="scss">
.file{
  &-container{
    position: relative;
   }
  &-core{
    margin:2rem 15rem 0 15rem
  }
}
</style>
